<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<!--标准mui.css-->
		<link rel="stylesheet" href="../css/mui.min.css">
		<link rel="stylesheet" href="../css/app.css">
		<!--App自定义的css-->
		<style type="text/css">
			html, body{
				background: #fff;
			}
			.mui-content{
				background: #fff;
				display: none;
			}
			.mui-preview-image.mui-fullscreen {
				position: fixed;
				z-index: 20;
				background-color: #000;
			}
			.mui-preview-header,
			.mui-preview-footer {
				position: absolute;
				width: 100%;
				left: 0;
				z-index: 10;
			}
			.mui-preview-header {
				height: 44px;
				top: 0;
			}
			.mui-preview-footer {
				height: 50px;
				bottom: 0px;
			}
			.mui-preview-header .mui-preview-indicator {
				display: block;
				line-height: 25px;
				color: #fff;
				text-align: center;
				margin: 15px auto 4;
				width: 70px;
				background-color: rgba(0, 0, 0, 0.4);
				border-radius: 12px;
				font-size: 16px;
			}
			.mui-preview-image {
				display: none;
				-webkit-animation-duration: 0.5s;
				animation-duration: 0.5s;
				-webkit-animation-fill-mode: both;
				animation-fill-mode: both;
			}
			.mui-preview-image.mui-preview-in {
				-webkit-animation-name: fadeIn;
				animation-name: fadeIn;
			}
			.mui-preview-image.mui-preview-out {
				background: none;
				-webkit-animation-name: fadeOut;
				animation-name: fadeOut;
			}
			.mui-preview-image.mui-preview-out .mui-preview-header,
			.mui-preview-image.mui-preview-out .mui-preview-footer {
				display: none;
			}
			.mui-zoom-scroller {
				position: absolute;
				display: -webkit-box;
				display: -webkit-flex;
				display: flex;
				-webkit-box-align: center;
				-webkit-align-items: center;
				align-items: center;
				-webkit-box-pack: center;
				-webkit-justify-content: center;
				justify-content: center;
				left: 0;
				right: 0;
				bottom: 0;
				top: 0;
				width: 100%;
				height: 100%;
				margin: 0;
				-webkit-backface-visibility: hidden;
			}
			.mui-zoom {
				-webkit-transform-style: preserve-3d;
				transform-style: preserve-3d;
			}
			.mui-slider .mui-slider-group .mui-slider-item img {
				width: auto;
				height: auto;
				max-width: 100%;
				max-height: 100%;
			}
			.mui-android-4-1 .mui-slider .mui-slider-group .mui-slider-item img {
				width: 100%;
			}
			.mui-android-4-1 .mui-slider.mui-preview-image .mui-slider-group .mui-slider-item {
				display: inline-table;
			}
			.mui-android-4-1 .mui-slider.mui-preview-image .mui-zoom-scroller img {
				display: table-cell;
				vertical-align: middle;
			}
			.mui-preview-loading {
				position: absolute;
				width: 100%;
				height: 100%;
				top: 0;
				left: 0;
				display: none;
			}
			.mui-preview-loading.mui-active {
				display: block;
			}
			.mui-preview-loading .mui-spinner-white {
				position: absolute;
				top: 50%;
				left: 50%;
				margin-left: -25px;
				margin-top: -25px;
				height: 50px;
				width: 50px;
			}
			.mui-preview-image img.mui-transitioning {
				-webkit-transition: -webkit-transform 0.5s ease, opacity 0.5s ease;
				transition: transform 0.5s ease, opacity 0.5s ease;
			}
			@-webkit-keyframes fadeIn {
				0% {
					opacity: 0;
				}
				100% {
					opacity: 1;
				}
			}
			@keyframes fadeIn {
				0% {
					opacity: 0;
				}
				100% {
					opacity: 1;
				}
			}
			@-webkit-keyframes fadeOut {
				0% {
					opacity: 1;
				}
				100% {
					opacity: 0;
				}
			}
			@keyframes fadeOut {
				0% {
					opacity: 1;
				}
				100% {
					opacity: 0;
				}
			}
			p img {
				max-width: 100%;
				height: auto;
			}
			.mui-content{
				position:relative;
				margin-top:44px;
				padding:0px!important;
			}
			.mui-content-padded,.mui-content-time{
				margin:55px 10px 0px 10px;	
			}
			.mui-content-time span{
				color:#000;/*#9fa41c;*/
				/*font-weight: 700;*/
			}
			.mui-goods-title1,.mui-goods-price1{
				display: block;
				float: left;
			}
			.mui-goods-title2,.mui-goods-price2{
				display: block;
				float: right;
			}
			.clear{
				clear: both;
			}
			a{
				color:#333;
			}
			.mui-goods{
				font-size:16px;
				/*font-weight: bold;*/
				line-height: 30px;
				margin:0 0 20px;
				/*position:fixed;*/
				/*bottom: 0;*/
				/*background: #fff;*/
				width:100%;
				padding: 0 10px;
			}
			
			.mui-goods-btn{
				border-radius: 5px;
				background: #9fa41c;
				padding:0px 10px;
				color:#fff
			}
			.mui-goods-btn:active{
				color:#fff;
				background: #d9dba4;
			}
			.mui-goods-price1{
				color:#E4393C;
			}
		</style>

	</head>

	<body>
		<div class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">商品详情</h1>
			<!--<span class="mui-icon mui-icon-more-filled mui-pull-right"></span>-->
		</div>
		<div class="mui-content">
			<div class="mui-content-padded" id="mui-goods-content">
				
				
			</div>
			<div class="mui-goods">
					<div class="mui-goods-title"><a class="mui-goods-title1">小型基本套餐</a><!--<a class="mui-goods-title2">套餐包含</a>--><div class="clear"></div</div>
					<div class="mui-goods-price"><a class="mui-goods-price1">￥6300</a><a class="mui-goods-price2 mui-goods-btn" data-id="0">立即购买</a><div class="clear"></div></div>
				</div>
		</div>
	</body>
	<script src="../js/mui.min.js"></script>
	<script src="../js/mui.zoom.js"></script>
	<script src="../js/mui.previewimage.js"></script>
	<script src="../js/castapp.js"></script>
	<script src="../js/myapp.js"></script>
	<script>
		ca.init();
		
		//接收通知消息
		ca.receiveNotice("goodsInfo",function(event){
			//获取对象id
			var id = event.detail.id;
			console.log(id);
			get_goods_info(id);
			lazyLoading('mui-content',function(){
				
			});
		});
		ca.className('mui-goods-btn')[0].addEventListener('tap',function(e){
			var thisEl = e.currentTarget;
			var data_id = thisEl.attributes['data-id'].value;
			console.log(data_id);
		});
		function get_goods_info(id){
			var access_token = localStorage.getItem('access_token');
			var url = request_url+'/api/public/get_goods_info';
			ca.get({
				url:url,
				data:{
					access_token:access_token,
					goods_id:id
				},
				succFn:function(res){
					var json = JSON.parse(res);
					console.log(res);
					if(json.status == 1){
						ca.id('mui-goods-content').innerHTML = json.info.content;
						ca.className('mui-goods-price1')[0].innerHTML = '￥' + json.info.price;
						ca.className('mui-goods-title1')[0].innerHTML = '￥' + json.info.name;
						ca.className('mui-goods-btn')[0].attributes['data-id'].value = json.info.id;
					}
					else{
						ca.prompt(json.msg);
					}
				}
			});
		}
	</script>

</html>